package io;

import java.io.File;
import java.io.FilenameFilter;

/**
 * @Author wangzhipeng
 * @Date 2020-08-18 6:45 下午
 * @Description
 */
public class Wokr {
    public static void main(String[] args) {
        File file = new File("/Users/wangzhipeng/Desktop");
        Wokr.search(file);




    }
    public static void search(File file){
        File[] files = file.listFiles(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return true;
            }
        });
        for(File item:files){
            System.out.println(item.getName());
            if (item.isDirectory()){
                search(item);
            }
        }
    }
    
    
    
}
